Data having a high rewriting frequency is written into a block belonging to a group that has a low bit error rate. Alternatively, data having a low rewriting frequency is written into a block that belongs to a group having a high bit error rate.